<?php

/**
 * 学生表
 */
namespace app\voip\func;


use app\voip\model\EChildren;

class ChildrenFunc
{

    /**
     * @param $where
     * @param $data
     * @return EChildren
     */
    static public function update($data,$where)
    {
        return EChildren::update($data,$where);
    }
    /**
     * @param $data
     * @return array|false
     * @throws \Exception
     */
    static public function addAll($data)
    {
        $children=new EChildren();
        return $children->saveAll($data,false);
    }

    /**
     * @param $id
     * @return array|false|\PDOStatement|string|\think\Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    static public function getInfo($id)
    {
        $obj = new EChildren();
        return $obj->alias('c1')->join('e_home_address h1','c1.id=h1.cid')->where('c1.id',$id)->field('c1.*,h1.detailed_addr')->find();
    }
}